package com.to.aboomy.bannersample.slice;

import com.to.aboomy.bannersample.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Button;

/**
 * @since 2021-07-21
 */
public class LunchAbilitySlice extends AbilitySlice {
    @Override
    protected void onStart(Intent intent) {
        super.onStart(intent);
        setUIContent(ResourceTable.Layout_ability_lunch);
        Button viewPager1 = (Button)findComponentById(ResourceTable.Id_view1);
        Button viewPager2 = (Button)findComponentById(ResourceTable.Id_view2);
        viewPager1.setClickedListener(component -> {
            present(new ViewPagerLunchAbilitySlice(), new Intent());
        });

        viewPager2.setClickedListener(component -> {
            present(new ViewPager2LunchAbilitySlice(), new Intent());
        });
    }
}
